//
// Created on 2024/5/20.
//
// Node APIs are not fully supported. To solve the compilation error of the interface cannot be found,
// please include "napi/native_api.h".

#include "NativeBasic.h"
#include "util/Transformer.h"

namespace rcim {

// NativeBool ******************************************************************************
NativeBool::NativeBool(bool value) { this->value = value; }
napi_value NativeBool::toValue(napi_env env) { return trans::boolToValue(env, this->value); }

// NativeInt32 ******************************************************************************
NativeInt32::NativeInt32(int value) { this->value = value; }
napi_value NativeInt32::toValue(napi_env env) { return trans::int32ToValue(env, this->value); }

// NativeInt64 ******************************************************************************
NativeInt64::NativeInt64(long value) { this->value = value; }
napi_value NativeInt64::toValue(napi_env env) { return trans::int64ToValue(env, this->value); }

// NativeString ******************************************************************************
NativeString::NativeString(const char *cPtr) { this->value = trans::charToStringFromSafety(cPtr); }
NativeString::NativeString(std::string str) { this->value = str; }
napi_value NativeString::toValue(napi_env env) { return trans::stringToValue(env, this->value); }

} // namespace rcim